{include file="public/head"/}
<style>
    .layui-form-label {
        width: 130px;
    }

    .layui-input-block {
        margin-left: 160px;
    }

    #imgTable + .layui-table-view tbody > tr > td {
        padding: 0;
    }

    #imgTable + .layui-table-view tbody > tr > td > .layui-table-cell {
        height: 60px;
        line-height: 60px;
    }

    .layui-treeSelect .ztree li span.button.switch {
        position: relative;
        top: -6px;
    }

    #image img {
        max-width: 160px;
        max-height: 124px;
        overflow: hidden;
    }

    .layui-upload-img {
        width: 100%;
        height: 100%;
    }

    .delimages {
        position: relative;
        width: 200px;
        height: 200px;
        margin: 0 10px 10px 0;
        display: inline-block;
    }

    .click_delimages {
        position: absolute;
        bottom: 0;
        width: 100%;
        text-align: center;
        color: #fff;
        background-color: #9e9e9ea1;
        cursor: pointer;
    }

    .attr-item .attr-name {
        padding: .15rem .75rem;
        display: inline-block;
    }

    .attr-item .attr-delete {
        padding: .24rem .6rem;
        background: #d4cece;
        color: #fff;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
    }

    .tablediv td, .tablediv th {
        padding: .75rem;
    }

    .tag-item .tag-name {
        padding: .15rem .75rem;
        display: inline-block;
    }

    .tag-item .tag-delete {
        padding: .24rem .6rem;
        background: #d4cece;
        color: #fff;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
    }
</style>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body" pad15>
                    <div class="layui-form" wid100 lay-filter="">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li class="layui-this">订单详情</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <div class="layui-form-item">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">订单编号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="order_sn" readonly lay-verify="required"
                                                       value="{$info.order_sn|default=''}" placeholder="采购订单编号"
                                                       class="layui-input">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">订单商品</label>
                                        <div class="layui-col-md6">
                                            <textarea name="" id="" readonly
                                                      class="layui-textarea editor">{$info.goods|default=''}</textarea>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">订单总价</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="total_price" readonly lay-verify="required"
                                                       value="{$info.total_price|default=''}" placeholder="商品名称"
                                                       class="layui-input">
                                            </div>
                                        </div>
                                    </div>


                                    <div class="layui-form-item">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">收货地址</label>
                                            <div class="layui-input-inline">
                                                <input type="text" style="width: 320px" readonly lay-verify="required"
                                                       value="{$info.order_address|default=''}" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">收货人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" readonly lay-verify="required"
                                                       value="{$info.order_name|default=''}" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">联系电话</label>
                                            <div class="layui-input-inline">
                                                <input type="text" readonly lay-verify="required"
                                                       value="{$info.order_mobile|default=''}" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">备注</label>
                                        <div class="layui-col-md6">
                                            <textarea name="remarks" id="remarks" readonly
                                                      class="layui-textarea editor">{$info.remarks|default=''}</textarea>
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">评分</label>
                                            <div class="layui-input-inline">
                                                {if condition="$info['comment']"}
                                                    <input type="text" readonly lay-verify="required"
                                                           value="{$info.comment}星" class="layui-input">
                                                {else}
                                                    <input type="text" readonly lay-verify="required"
                                                           value="暂无评分" class="layui-input">
                                                {/if}

                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">评价</label>
                                        <div class="layui-col-md6">
                                            <textarea name="comment_content" id="comment_content" readonly
                                                      class="layui-textarea editor">{$info.comment_content|default=''}</textarea>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">订单状态</label>
                                        {if condition="$info['status'] == 1"}
                                            <input type="radio" name="status" readonly value="1" title="待支付" checked>
                                        {elseif ($info['status'] == 2)}
                                            <input type="radio" name="status" readonly value="2" title="已支付" checked>
                                        {elseif ($info['status'] == 3)}
                                            <input type="radio" name="status" readonly value="3" title="待核销" checked>
                                        {elseif ($info['status'] == 4)}
                                            <input type="radio" name="status" readonly value="4" title="已核销" checked>
                                        {elseif ($info['status'] == 5)}
                                            <input type="radio" name="status" readonly value="5" title="已评价" checked>
                                        {/if}
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="id" value="{$info.id|default=''}">
                                <!--
                                <button class="layui-btn" lay-submit lay-filter="edit-but">确认保存</button>
                                -->
                            </div>
                        </div>

                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

{include file="public/foot"/}

<script>
    layui.config({
        base: '__LAYDMIN__/', {if config('app.app_debug')}version: true{/if}
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'admin', 'table', 'colorpicker', 'upload'], function () {
        var $ = layui.$, admin = layui.admin, table = layui.table, element = layui.element, form = layui.form,
            util = layui.util, upload = layui.upload, colorpicker = layui.colorpicker;
        //编辑提交
        var uri = "{if isset($info['id'])}{:url(SYS_PATH.'/'.CONTROLLER.'/edit')}{else}{:url(SYS_PATH.'/'.CONTROLLER.'/add')}{/if}";
        form.on('submit(edit-but)', function (data) {
            admin.req({
                url: uri //实际使用请改成服务端真实接口
                , type: 'post'
                , data: data.field
                , done: function (res) {
                    window.top.layer.msg(res.msg, {icon: 1, time: 1000,shade:[0.5,'#000']}, function () {
                        layer.closeAll("iframe");
                        //刷新父页面
                        parent.location.reload();
                    });
                }
            });
        });


        //上传logo
        var thumb = $('#goods_cover');
        upload.render({
            url: '{:url(SYS_PATH."/uploads/upimg")}'
            , elem: '#thumbUpload'
            , done: function (res) {
                if (res.code == 0) {
                    thumb.val(res.url);
                    //logo.parent().append('<input type="hidden" name="logo_aid" value="'+res.aid+'">')
                } else {
                    layer.msg(res.msg, {icon: 5});
                }
            }
        });
        //查看logo
        admin.events.logoShow = function (othis) {
            var src = thumb.val();
            layer.photos({
                photos: {
                    "title": "查看图片" //相册标题
                    , "data": [{
                        "src": src //原图地址
                    }]
                }
                , shade: 0.01
                , closeBtn: 1
                , anim: 5
            });
        };

    });
</script>
</body>
</html>